Repository navigation
Fix GNU sparse 1.0 maps spanning multiple TAR records - #135626
Merged
Merged
Conversation
Check refill capacity after excluding consumed bytes so valid GNU sparse 1.0 maps can span multiple TAR records. Preserve the existing buffer and segment-count limits, and cover boundary-sized maps, extraction, archive advancement, and malformed inputs. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9b3e8fbb-f56a-48da-9df9-8c67a81584d0
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @dotnet/area-system-formats-tar |
Member
Author
|
/ba-g Mutex test failures are unrelated |
rzikm
enabled auto-merge (squash)
October 19, 2026 11:17
Member
Author
|
/backport to release/11.0 |
Contributor
|
Started backporting to |
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Valid GNU sparse 1.0 PAX entries can throw
InvalidDataExceptionwhen their embedded sparse map exceeds approximately 1 KiB. The refill-capacity check includes already-consumed bytes that the next refill would discard during compaction.Calculate capacity using only unread bytes. This preserves the fixed 1 KiB buffer, the 1,000,000-segment allocation limit, numeric-line bounds, and record-aligned packed-data positioning.
Regression coverage checks exact record boundaries, the reported 1,006-byte and 1,062-byte map sizes, and an 8,193-byte map. It covers sync/async reads and extraction, copied/non-copied data, non-seekable inputs, next-entry alignment, and malformed maps.
Validation
Commands ran through a short
substpath on Windows x64:.\build.cmd clr+libs -rc Release- passed..\dotnet.cmd build src\libraries\System.Formats.Tar\src\System.Formats.Tar.csproj- passed for the Windows and Unix target assemblies..\dotnet.cmd build /t:test src\libraries\System.Formats.Tar\tests\System.Formats.Tar.Tests.csproj '/p:XUnitOptions=-class System.Formats.Tar.Tests.TarReader_SparseFileTests'- 159 cases executed; 32 valid-map cases failed before the fix, and all 159 passed afterward..\dotnet.cmd build /t:test src\libraries\System.Formats.Tar\tests\System.Formats.Tar.Tests.csproj- all 7,084 standard tests passed, with zero skips.Both original issue archives passed sync/async reading and directory extraction after the fix, with expanded lengths and SHA-256 hashes matching Python
tarfile. Non-Windows test execution and the multi-gigabyte manual stress project were not run.Fixes: #134980
Resolves #134980
Note
This description was generated by GitHub Copilot.